import { defineStore } from 'pinia'

export const useHomeStore = defineStore('home', {
	state: () => {
		return {
			counter: 0,
			homeInfo: {},
		}
	},
	actions: {
		increment() {
			this.counter++
		},

		async fetchHomeData() {
			const url = 'http://codercba.com:9060/juanpi/api/homeInfo'

			const { data } = await useFetch(url)
			this.homeInfo = data.value.data
		},
	},
})
